#@adminLayout()
#define main()
<div class="jbolt_page" data-key="#(pmkey)"  >
    <div class="jbolt_page_title">
        <div class="row">
            <div class="col-2">
                <h1>退货管理</h1>
                <span> #(pageData.totalRow?? 0) 条记录</span>
            </div>
            <div class="col-8">
                <form class="form-inline" id="OrderReturnForm" action="/auth/mall/order/return"  data-pjaxsubmit  method="get">
                    <select class="form-control"
                            name="retailerId"
                            id="retailerId"
                            data-autoload
                            data-url="/auth/mall/order/return/return_retailer_option"
                            data-text="请选择商家"
                            data-value=""
                            data-select="#(retailerId??)"
                    >
                    </select >
                    <select class="form-control ml-1"  data-url="/auth/mall/order/return/get_order_return_time" id="onTime" name="onTime" data-autoload data-text="=退单时间=" data-value="" data-select="#(onTime??)"></select>

                    <input type="text" autocomplete="off"  class="form-control"  placeholder="输入关键字搜索" id="keywords" name="keywords" value="#(keywords??)" />
                    <input type="hidden" name="isDelete" value="#(isDelete?? false)"/>
                    <button  type="button" onclick="normaReturnlData()" class="btn btn-light" ><i class="fa fa-search"></i> 查询</button>
                    <button  onclick="Testreset()" class="btn btn-light"  ><i class="fa fa-refresh"></i> 重置</button>
                    <!--                    <button  type="button" onclick="trashMemberData()" class="btn btn-#((isDelete?? && isDelete=='true')?'danger':'light')" ><i class="fa fa-trash"></i> 回收站(#(deleteCount?? 0))</button>-->
                </form>
            </div>
        </div>
    </div>
    <div class="jbolt_page_content">
        <div class="table-responsive">
            <table class="table table-bordered table-hover table-striped table-center">
                <thead>
                <tr>
                    <th style="width: 60px">序号</th>
                    <th style="width: 100px">退货商品</th><th style="width: 100px">商家</th>
                    <th style="width: 100px">商品数量</th> <th style="width: 100px">商品金额</th>
                    <th style="width: 100px">订单号</th><th style="width: 100px">提交时间</th>
                    <th  style="width: 30px">折扣金额</th><th style="width: 30px">积分</th>
                    <th style="width: 30px">平台佣金</th>
                    <th style="width: 30px">优惠券金额</th><th style="width: 30px">退款金额</th>
                    <th style="width: 160px">退款原因</th>
                    <th style="width: 50px">操作</th>
                </tr>
                </thead>
                <tbody>
                #if(pageData)
                #for(data:pageData.list)
                <tr>
                    <td>#(for.index+1)</td>
                    <td>#(data.commodity_name??)</td>
                    <td>#(data.retailer_name??)</td>
                    <td>#(data.amount)</td>
                    <td>#(MyUtil.get_price_string(data.price??)??0.00)</td>
                    <td>#(MyUtil.get_order_order_id(data.order_id??)??)</td>
                    <td>#(MyUtil.get_date(data.time_submit))</td>


                    <td>#(MyUtil.get_price_string(data.discount??)??0.00)</td>
                    <td>#(MyUtil.get_price_string(data.credit??)??0.00)</td>
                    <td>#(MyUtil.get_price_string(data.commission??)??0.00)</td>
                    <td>#(MyUtil.get_price_string(data.coupon??)??0.00)</td>
                    <td>#(MyUtil.get_price_string(data.refund_amount??)??0.00)</td>

                    <td>#(data.reason??)</td>

                    <td>

                        <a  tooltip  title="通过"  href="/auth/mall/order/return/pass_retailer/#(data.id)" data-handler="refreshPjaxContainer" data-confirm="确定通过此退单请求?" class="jbolt_table_delbtn"> <i class="fa fa-check mr-2 c-danger"></i></a>
                        <a  tooltip  title="拒绝/驳回"  href="/auth/mall/order/return/get_order_return_form/#(data.id)" data-handler="refreshPjaxContainer"   class="jbolt_table_delbtn"  data-jboltlayertrigger data-width="500" data-noclose data-confirm> <i class="fa fa-remove c-danger"></i> </a>

                    </td>
                </tr>
                #end
                #end
                </tbody>
            </table>
        </div>
        #include("/_view/_admin/common/_page.html",pageEleId="orderReturnPage")
    </div>
</div>
</div>
</div>
#end
#define js()
<script type="text/javascript">

    var returnFormIndex=$("#OrderReturnForm");

    $(function(){
        initPage("orderReturnPage",#(pageData.totalPage??),#(pageData.pageNumber??),"OrderReturnForm");
    });


    /**
     * 普通查询
     */
    function normaReturnlData(){
        returnFormIndex.find("[name='isDelete']").val(false);
        returnFormIndex.submit();
    }

    /**
     * 查回收站
     */
    function trashOrderData(){
        returnFormIndex.find("[name='isDelete']").val(true);
        returnFormIndex.submit();
    }


    function Testreset() {
        document.getElementById("keywords").value = "";
        document.getElementById("retailerId").value = "";
        document.getElementById("onTime").value = "";

    }

    //测试可刷新 -- 提交表单
    function RefreshsubmitForm(formEId){
        var form=getRealJqueryObject(formEId);
        if(FormChecker.check(form)){
            // LayerMsgBox.loading("执行中...");
            // var formData=form.serialize();
            var url=form.action;
            form.ajaxSubmit({
                type:"post",
                url:url,
                success:function(ret){
                    if(ret.state=="ok"){
                        LayerMsgBox.success(ret.msg,500,function(){
                            refreshPjaxContainer();
                        });
                    }else{
                        LayerMsgBox.alert(ret.msg,2);
                    }
                }
            });
        }
        return false;
    }

</script>



#end

